Yum Repo for jenkins:
  file.managed:
    - name: /etc/yum.repos.d/jenkins.repo
    - contents: |
        [jenkins]
        name=Jenkins
        baseurl=http://pkg.jenkins-ci.org/redhat
        gpgcheck=1
    
Copy jenkins file:
  file.managed:
    - name: /tmp/jenkins-2.1-1.1.noarch.rpm
    - source: /srv/files/jenkins-2.1-1.1.noarch.rpm
    - unless: test -f /tmp/jenkins-2.1-1.1.noarch.rpm

Install jenkins:
  cmd.run:
    - name: |
        cd /tmp
        rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
        rpm -ivh jenkins-2.1-1.1.noarch.rpm
        service jenkins start
    - unless: test -f /etc/init.d/jenkins

#setting slave node： http://m.myexception.cn/open-source/1469741.html

#/etc/sysconfig/jenkins：jenkins配置文件

# chmod a+x /etc/init.d/jenkins
# chkconfig jenkins on
# service jenkins start